{extend name="public/base" /}
{block name='content'}
{include file='public/content_header' /}
<style type="text/css">
    .bg {
        background-color: rgba(0,0,0,0.6);
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0px;
    }
    .tk {
        width: 260px;
        height: 140px;
        position: absolute;
        left: 36%;
        background: #fff;
        top: 28%;
    }
    .tk .tk_top {
        height: 35px;
        line-height: 35px;
        background-color: #3c8dbc;
    }
    .tk_top .tk_left {
        float: left;
        margin: auto 8px;
        color: #fff;
    }
    .tk_top .tk_right {
        float: right;
        margin: auto 8px;
        color: #fff;
        cursor:pointer;
    }
    .tk .tk_con {
        height: 70px;
        line-height: 70px;
    }
    .tk .tk_con input {
        border: 1px solid #ecdede;
        font-size: 12px;
        padding-left: 6px;
    }
    .tk .dbu {
        margin-top: 4px;
        height: 25px;
        line-height: 25px;
    }
    .tk .dbu .dbu_qr {
        float: left;
        background-color: #3c8dbc;
        width: 42px;
        text-align: center;
        margin-left: 10px;
        border-radius: 3px;
        cursor:pointer;
    }
    .dbu .dbu_qr span {
        color: #fff;
        font-size: 12px;
    }
    .tk_con .mon {
        margin-left: 15px;
    }
    .tk_con .mon span {
        height: 30px;
        line-height: 30px;
    }
</style>
<!--数据列表页面-->
<section class="content">

    <!--顶部搜索筛选-->
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-body">
                    <form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">

                        <div class="form-group">
                            <input value="{$_keywords ? $_keywords : '' ;}"
                                   name="_keywords" id="_keywords" class="form-control input-sm" placeholder="">
                        </div>
                        <div class="form-group">
                            <button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
                            </button>
                        </div>
                        <div class="form-group">
                            <button onclick="exportData()" class="btn btn-sm btn-warning exportData" type="button"><i class="fa fa-search"></i> 导出
                            </button>
                        </div>
                        <div class="form-group">
                            <button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
                                    class="fa  fa-eraser"></i> 清空查询
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="box">

                <!--数据列表顶部-->
                <div class="box-header">
                    <div>
                        <!--<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm "  href="{:url('add')}">-->
                            <!--<i class="fa fa-plus"></i> 添加-->
                        <!--</a>-->
                        <a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据" data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗？" data-id="checked" data-url="{:url('del')}">
                            <i class="fa fa-trash"></i> 删除
                        </a>

                        <a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
                            <i class="fa fa-refresh"></i> 刷新
                        </a>
                    </div>
                </div>

                <div class="box-body table-responsive">
                    <table class="table table-hover table-bordered datatable" width="100%">
                        <thead>
                        <tr>
                            <th>
                                <input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox" placeholder="全选/取消">
                            </th>
                            <th>序号</th>
                            <th>站长id</th>
                            <th>内容</th>
                            <th>处理人</th>
                            <th>状态</th>
                            <!--0 待处理 1已处理-->
                            <th>处理时间</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name='data' id='item' key='data_key'}
                        <tr>
                            <td>
                                <input type="checkbox" onclick="checkThis(this)" name="data-checkbox" data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}" placeholder="选择/取消">
                            </td>
                            <td>{$item.id}</td>
                            <td>{$item.uid}</td>
                            <td>{$item.content}</td>
                            <td>{$item.adminuser}</td>
                            {if condition="$item.cond_text eq '已处理'"}
                            <td>{$item.cond_text}</td>
                            {else /}
                            <td style="color:red;">{$item.cond_text}</td>
                            {/if}
                            <td>{$item.dotime}</td>
                            <td>{$item.create_time}</td>

                            <td class="td-do">
                                <a href="JavaScript:void(0)"
                                   class="btn btn-primary btn-xs" title="审核" onclick="she_Ok({$item.id})" data-toggle="tooltip">
                                    <i class="fa fa-cog"></i>
                                </a>
                                <a href="{:url('edit',['id'=>$item.id])}"
                                   class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
                                    <i class="fa fa-pencil"></i>
                                </a>
                                <a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除"  data-id="{$item.id}" data-confirm-title="删除确认" data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗' data-url="{:url('del')}">
                                    <i class="fa fa-trash"></i>
                                </a>
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>
                <!--弹框-开始-->
                <div class="bg" style="display:none;"></div>
                <div class="tk" style="display:none;">
                    <div class="tk_top">
                        <div class="tk_left">编辑</div>
                        <div class="tk_right" onclick="cha()">X</div>
                    </div>
                    <div class="tk_con">
                        <div class="mon">
                            <span>处理：<input type="radio" class="cb-radio" name="status" value="1" />&nbsp;是</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span><input type="radio" class="cb-radio" name="status" value="0" />&nbsp;否</span>
                        </div>
                    </div>
                    <div class="dbu">
                        <input type="hidden" id="tid" />
                        <div class="dbu_qr" onclick="qren()"><span>确认</span></div>
                    </div>
                </div>
                <script type="text/javascript">
                    function she_Ok(e)
                    {
                        $(".bg").show();
                        $(".tk").show();
                        $("#tid").val(e);
                    }

                    function cha()
                    {
                        $(".bg").hide();
                        $(".tk").hide();
                        $("#tid").val('');
                    }

                    //确认
                    function qren()
                    {
                        var radio = $("input[name='status']:checked").val();
                        var tid = $("#tid").val();

                        if(radio==undefined)
                        {
                            layer.msg("请选择审核状态！");
                            return false;
                        }

                        layer.confirm('确认对反馈状态审核？', {
                            btn : [ '确定', '取消' ] //按钮
                        }, function(index) {

                            $.ajax({
                                url:"{:url('admin/UserFeed/auditUserFeed')}",
                                type:"post",
                                dataType:"json",
                                data:{radio:radio,tid:tid},
                                success:function(data){
                                    if(data.errorCode==200){
                                        layer.msg(data.msg);
                                        layer.close(index);
                                        window.parent.location.reload();
                                        return false;
                                    }
                                }
                            });
                        });
                    }
                </script>
                <!--弹框-结束-->
                <!-- 数据列表底部 -->
                <div class="box-footer">
                    {$page|raw}
                    <label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
                        <small>共{$total}条记录</small>&nbsp;
                        <small>每页显示</small>
                        &nbsp;
                        <select class="input-sm" onchange="changePerPage(this)">
                            <option value="10" {if $admin.per_page==10}selected{/if}>10</option>
                            <option value="20" {if $admin.per_page==20}selected{/if}>20</option>
                            <option value="30" {if $admin.per_page==30}selected{/if}>30</option>
                            <option value="50" {if $admin.per_page==50}selected{/if}>50</option>
                            <option value="100" {if $admin.per_page==100}selected{/if}>100</option>
                        </select>
                        &nbsp;
                        <small>条记录</small>
                    </label>
                </div>

            </div>
        </div>
    </div>
</section>

{/block}